import time
def sortirovka(d):
    f=True
    while f:
        f=False
        for i in range(len(d)-1):
            if d[i] >d[i+1]:
                d[i],d[i+1]= d[i+1], d[i]
                f=True
m1=list(map(int, open('m1_sorted.txt').read().splitlines()))
m2=list(map(int, open('m2_reverse.txt').read().splitlines()))
m3=list(map(int, open('m3_shuffle.txt').read().splitlines()))
t0=time.time()
sortirovka(m1)
t=time.time()
print("m1_sorted",round((t-t0)*1000),"milliseconds")
t0=time.time()
sortirovka(m2)
t=time.time()
print("m2_reverse",round((t-t0)*1000),"milliseconds")
t0=time.time()
sortirovka(m3)
t=time.time()
print("m3_shuffle",round((t-t0)*1000),"milliseconds")
